package co.yixiang.modules.user.service.mapper;

import co.yixiang.common.mapper.CoreMapper;
import co.yixiang.modules.user.domain.Area;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author lsh
* @date 2021-04-19
*/
@Repository
public interface AreaMapper extends CoreMapper<Area> {

    @Select("SELECT * FROM AREA m WHERE m.id NOT IN (SELECT t.area_id FROM yx_user t WHERE t.area_id IS NOT NULL) and m.name LIKE '%${name}%'")
    List<Area> query4operate(@Param("name") String name);

}
